NodeFileSeekableSource

class NodeFileSeekableSource(pathStr: String) : SeekableSource(source)

A Node.js-specific SeekableSource implementation for Kotlin/JS that performs synchronous random access via the Node.js fs module (openSync, readSync, fstatSync, closeSync).

This class is intended for Node.js environments (CLI, server, or tests) and is not supported in browser runtimes.

Parameters

pathStr

the filesystem path to the archive file to open in read-only mode.

Constructors

Link copied to clipboard
constructor(pathStr: String)

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun length(): Long

Returns the total size of the underlying data source in bytes.

Link copied to clipboard
open override fun position(): Long

Returns the current zero-based read offset in bytes from the beginning of the stream.

Link copied to clipboard
open override fun read(buffer: ByteArray, offset: Int, length: Int): Int

Reads up to length bytes from the current position into buffer starting at offset.

Link copied to clipboard
open override fun seek(position: Long)

Sets the absolute byte offset from the beginning of the stream for the next read operation.